package com.macro.mall.portal.repository;

import com.macro.mall.portal.domain.MemberProductCollection;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;

/**
 * @author wangwang
 * @version 1.0
 * @description 会员商品收藏Repository
 * @date 2025/7/31 20:34
 */
public interface MemberProductCollectionRepository extends MongoRepository<MemberProductCollection, String> {

    MemberProductCollection findByMemberIdAndProductId(Long memberId, Long productId);

    void deleteAllByMemberId(Long id);

    Page<MemberProductCollection> findByMemberId(Long id, Pageable pageable);

    int deleteByMemberIdAndProductId(Long id, Long productId);
}
